import time

from Sanzhou.page.page import Page
from selenium.webdriver.ie.service import Service
from selenium import webdriver
import pytest

@pytest.fixture(scope='function')
def driver():
    firefox_driver=Service(r'C:\Program Files\Mozilla Firefox\firefox.exe1')
    driver=webdriver.Firefox()

    driver.implicitly_wait(10)
    yield driver
    driver.quit()

def test_taobao(driver):
    po=Page(driver)
    po.open_url('https://www.taobao.com/')
    time.sleep(10)
    po.zhineng()
    time.sleep(3)
    po.zhixing()
    time.sleep(3)
    assert '智能手机' in po.yemian()
    print(f'搜索到的商品信息:{po.yemian()}')
    po.save()